package com.general.framework.core.exception;

/**
 * @author leejean
 * SystemErrorException
 * 系统错误异常，用于封装jdk层抛出的异常以及未知异常
 * @date 2020年05月20 10:29:13
 */
public class SystemErrorException extends BaseException {

    public SystemErrorException(Throwable cause) {
        super(cause);
    }

    public SystemErrorException(String message) {
        super(message);
    }

    public SystemErrorException(final ICode errorCode) {
        super(errorCode);
    }

    public SystemErrorException(final String message, final Throwable cause) {
        super(message, cause);
        this.code = getDefaultCode();
    }

    public SystemErrorException(Integer code, String message) {
        super(code, message);
    }

    public SystemErrorException(Integer code, String message, Throwable cause) {
        super(code, message, cause);
    }

    @Override
    public Integer getDefaultCode() {
        return CodeEnum.SYSTEM_ERROR.getCode();
    }
}
